﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3
{
    public partial class WebForm7 : System.Web.UI.Page
    {
        private DataClassesHealthDataContext dc = new DataClassesHealthDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            ultext.Visible = true;
            likq.Visible = false;
            if (!Page.IsPostBack)
            {
               
            }
        }

        protected void ButtonRegister_Click(object sender, EventArgs e)
        {
           
             string username = this.TextBoxUsername.Text;
             string firstname = this.TextBoxFirstname.Text;
            string lastname = this.TextBoxLastname.Text;
            string password = this.TextBoxPassword.Text;
            DateTime joindate = DateTime.Now;
            string address = this.TextBoxContact.Text;
            string contactinfo = this.TextBoxContact.Text;
            string country = this.TextBoxCountry.Text;
            string city = this.TextBoxCity.Text;
            thememp(username, firstname, lastname, password, joindate, address, contactinfo, country, city);
            ultext.Visible = false;
            likq.Visible = true;
        }
        public void thememp(string username,string firstname,string lastname ,string password,DateTime joindate,string address,string contactinfo,string country,string city )
        {
            EmpRegister em = new EmpRegister();
            em.username = this.TextBoxUsername.Text;
            em.firstname = this.TextBoxFirstname.Text;
            em.lastname = this.TextBoxLastname.Text;
            em.password = this.TextBoxPassword.Text;
            em.joindate = DateTime.Now;
            em.address = this.TextBoxContact.Text;
            em.contactinfo = this.TextBoxContact.Text;
            em.country = this.TextBoxCountry.Text;
            em.city = this.TextBoxCity.Text;
            dc.EmpRegisters.InsertOnSubmit(em);
            dc.SubmitChanges();
          
        }
    }
}